<?php

namespace catchAdmin\externalGoods\controller;

use catchAdmin\externalGoods\model\NewNotify as NewNotifyModel;
use catcher\base\CatchRequest as Request;
use think\Request as ThinkRequest;
use catcher\CatchAdmin;
use catcher\CatchAuth;
use catcher\CatchResponse;
use houniao\api\v1\Goods as GoodsApi;

class NewNotify extends CatchAdmin
{
    public function __construct(NewNotifyModel $NewNotifyModel)
    {
        $this->model = $NewNotifyModel;
    }

    public function index(CatchAuth $auth, Request $request)
    {
        $param = $request->param();
        $page = $request->param('page',1);
        $limit = $request->param('limit',10);

        $oldArray = $param;
        $fields = ['type'];
        $where = array_intersect_key($oldArray, array_flip($fields));

        return CatchResponse::success($this->model->getRecordByPage($where,$page,$limit));
    }
}